#ifndef _TYPE_MAP_
#define _TYPE_MAP_
#include <iostream>

using namespace std;

template < typename ... Tail >
struct Holder;

template <typename ValueType, typename Head, typename ... Tail >
struct Holder<ValueType, Head, Tail ... > :
    public Holder<ValueType, Head>,
    public Holder<ValueType, Tail ... >
{};

template <typename ValueType, typename Head >
struct Holder<ValueType, Head>
{
    Holder()
    {
        value = 10000;
    }
    
    ValueType value;
};

template < typename ... Types >
struct TypeMap;

template <typename ValueType, typename ... Types >
struct TypeMap<ValueType, Types ... > :
    public Holder<ValueType, Types ... >
{
    template <typename T>
    void set(const ValueType& value)
    {
        ((Holder<ValueType, T>*)this)->value = value;
    }
        
    template <typename T>
    ValueType get()
    {
        return ((Holder<ValueType, T>*)this)->value;
    }
};

#endif // _TYPE_MAP_
